//
//  MHMyInfoController.m
//  M-Saler
//
//  Created by Teresa on 2020/5/21.
//  Copyright © 2020 Teresa. All rights reserved.
//

#import "MHMyInfoController.h"
#import "AppDelegate.h"

@interface MHMyInfoController ()

@property (weak, nonatomic) IBOutlet UILabel *telLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@end

@implementation MHMyInfoController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"个人中心";
    [self fillData];
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self configNavBarRed];
}

- (IBAction)logout:(id)sender {
    [MHUserModel logout];
    [self.navigationController popViewControllerAnimated:YES];
    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    [appDelegate backToHome];
    
    
}

-(void)fillData{
    MHUserModel *model = [MHUserModel userModel];
    self.telLabel.text = model.telphone;
    self.nameLabel.text = model.name;
}

@end
